package org.jeecg.modules.role.fallback;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.role.api.RoleApi;
import org.jeecg.modules.role.entity.SysRole;
import org.jeecg.modules.user.entity.SysUser;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@ConditionalOnMissingClass("org.jeecg.modules.system.controller.SysRoleController")
public class RoleFallback implements RoleApi {
    @Override
    public Result<Boolean> save(SysRole user) {
        throw new RuntimeException("角色权限未开通");
    }

    @Override
    public Result<SysRole> queryById(String id) {
        throw new RuntimeException("角色权限未开通");
    }

    @Override
    public Result<IPage<SysRole>> getByOrgAndDeptIdList(String organizationId, List<String> departList, String roleName, Integer pageNo, Integer pageSize) {
        throw new RuntimeException("角色权限未开通");
    }

    @Override
    public Result<IPage<SysUser>> listUserIdByRoleId(String roleId, String username, Integer pageNo, Integer pageSize) {
        throw new RuntimeException("角色权限未开通");
    }

    @Override
    public Result<?> delete(String id) {
        throw new RuntimeException("角色权限未开通");
    }

    @Override
    public Result<Map<String, Object>> getPermissionList(String orgId) {
        throw new RuntimeException("角色权限未开通");
    }
}
